
import QtQuick 1.0
//import Qt.labs.folderlistmodel 1.0

// prend exemple sur http://www.pluzz.fr/c-dans-l-air.html?sortie=rss
Rectangle {
    property alias rssSource : xmlModel.source
  
  
    id: window
    //color: "#3E606F"
    width: 1000
    height: 800
    focus: true
    
    function onSelectedPod(htmlSrc){
	console.log("selected**** :"  + htmlSrc );
    }
    
    XmlListModel {
	id: xmlModel
	//source: "http://feeds.feedburner.com/Pluzz-Actusociete?format=xml"
	query: "/rss/channel/item"
	XmlRole { name: "title"; query: "title/string()" }
	XmlRole { name: "pubDate"; query: "pubDate/string()" }
	XmlRole { name: "description"; query: "description/string()" }
	XmlRole { name: "image"; query: "image/string()" }
	XmlRole { name: "link"; query: "link/string()" }
    }
  
     Rectangle {
        id: rectDetail
        anchors.left: listItems.right
        width: 500
        height: 400
        color: "transparent"
        smooth: true
        //y:parent.y
        //anchors.verticalCenter: parent.verticalCenter      
        Image {id:imgDet; smooth: true ; fillMode: Image.PreserveAspectFit;width: 400;height: 400 }
        Text {
	  id: txtDet
	  wrapMode : Text.Wrap
	  anchors.top : imgDet.bottom
	  width:rectDetail.width-50
	  //anchors.left:img.right
	  text: ''
	  color: "white"
	  font.pixelSize: 20
	}	
    }
	
    ListView {
	    id: listItems
	    //anchors.horizontalCenter: parent.horizontalCenter	   
	    focus: true
	    x:20
	    width: 500
	    height: parent.height
            model:xmlModel
	    delegate: ListViewDelegate {}
	    spacing:20
	    preferredHighlightBegin : 150
	    preferredHighlightEnd : 500
	    highlightRangeMode : ListView.ApplyRange
	}

        
}
